package defectsim;

import java.awt.Color;
import java.awt.Paint;
import java.awt.Shape;
import java.awt.Stroke;
import java.awt.geom.Ellipse2D;
import java.awt.geom.Rectangle2D;

import repast.simphony.visualization.visualization2D.style.Style2D;
import edu.umd.cs.piccolo.PNode;
import edu.umd.cs.piccolo.nodes.PPath;
import edu.umd.cs.piccolo.nodes.PText;

/**
 * The 2D style class for sugar agents.   
 * The style is a red circle. 
 *
 * @author Eric Tatara
 * @author Nick Collier
 * @version 
 */

public class DislocationSourceStyle2D implements Style2D<DefectAgent> {

	Rectangle2D rect = new Rectangle2D.Float(0, 0, 3, 3);

	Shape s = new Ellipse2D.Float(0, 0, 3, 3);

	Stroke stroke = null;

	double rotation = 0.0;

	public DislocationSourceStyle2D() {
		super();
	}

	// Sets how the node is initially drawn (for new agents)
	public PNode getPNode(DefectAgent agent, PNode node) {
		PPath path = new PPath(s);
		path.setBounds(rect);
		path.setPaint(this.getPaint(agent));
		path.setStroke(this.getStroke(agent));
		path.setStrokePaint(this.getStrokePaint(agent));
		
		return path;
	}

	public Paint getPaint(DefectAgent agent) {
		return Color.LIGHT_GRAY;
	}
	public double getRotation(DefectAgent agent) {
		return rotation;
	}
	public void setRotation(double rot) {
		this.rotation = rot;
	}
	public void setBounds(Rectangle2D bounds) {
		this.rect = bounds;
	}
	public Rectangle2D getBounds(DefectAgent agent) {
		return rect;
	}
	public Stroke getStroke(DefectAgent agent) {
		return stroke;
	}
	public boolean isScaled(DefectAgent agent) {
		return true;
	}
	public Paint getStrokePaint(DefectAgent agent) {
		return Color.RED;
	}

	public PText getLabel(DefectAgent object) {
		// TODO Auto-generated method stub
		return null;
	}
}

